import productApi from "@/api/declaration/erp/productApi"
import httpRequest from "@/config/axios/httpRequest"
import { ProductCategoryModel } from "@/models/erp/ProductCategoryModel"




// ERP 产品分类 API
export const ProductCategoryApi = {
  // 查询产品分类列表
  getProductCategoryList: async () => {
    return await httpRequest.get(productApi.GetProductCategoryList)
  },

  // 查询产品分类精简列表
  getProductCategorySimpleList: async () => {
    return await httpRequest.get(productApi.GetProductCategorySimpleList)
  },

  // 查询产品分类详情
  getProductCategory: async (id: number) => {
    return await httpRequest.get(productApi.GetProductCategory, { params: { id } })
  },

  // 新增产品分类
  createProductCategory: async (data: ProductCategoryModel) => {
    return await httpRequest.post(productApi.CreateProductCategory, data)
  },

  // 修改产品分类
  updateProductCategory: async (data: ProductCategoryModel) => {
    return await httpRequest.put(productApi.UpdateProductCategory, data)
  },

  // 删除产品分类
  deleteProductCategory: async (id: number) => {
    return await httpRequest.delete(productApi.DeleteProductCategory, { params: { id } })
  },

  // 导出产品分类 Excel
  exportProductCategory: async (params) => {
    return await httpRequest.download(productApi.ExportProductCategory, params)
  }
}
